<!DOCTYPE html>
<html class="x-admin-sm">
    <head>
        <meta charset="UTF-8">
        <title>后台首页</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <link rel="stylesheet" href="./css/font.css">
  
		<link rel="stylesheet" type="text/css" href="layui/css/layui.css"/>
        <link rel="stylesheet" href="./css/xadmin.css">        
        <script src="layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="./js/xadmin.js"></script>
        <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
        <!--[if lt IE 9]>
          <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
          <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
    </head>
    <body>
<?php
$groupid = $cuserLogin->getgroupid();
$userid = $cuserLogin->getUserID();
if($groupid==3){
    $sp_dsh = $dsql->GetOne("select count(*) as dd from sea_subscribe where aid='$userid'");
    $yy_dsh = $dsql->GetOne("select count(*) as dd from sea_subscribe where stat=0 and  aid='$userid'");
    $wyy_dsh = $dsql->GetOne("select count(*) as dd from sea_subscribe where stat>3 and  aid='$userid'");
    $vodlist = $cuserLogin->getUserVodList();
    if($vodlist=='0'){
        $vod_dsh = $dsql->GetOne("select count(*) as dd from sea_vod");
        $vod1_dsh = $dsql->GetOne("select count(*) as dd from sea_vod where stat>0");
    }  
    else{
        $vod_dsh = $dsql->GetOne("select count(*) as dd from sea_vod where id in($vodlist)"); 
        $vod1_dsh = $dsql->GetOne("select count(*) as dd from sea_vod where id in($vodlist) and stat>0"); 
    }
       
}else{
    $sp_dsh = $dsql->GetOne("select count(*) as dd from sea_data");
    $yy_dsh = $dsql->GetOne("select count(*) as dd from sea_subscribe where stat=0");
    $wyy_dsh = $dsql->GetOne("select count(*) as dd from sea_subscribe where stat=5");
    $jq_dsh = $dsql->GetOne("select count(*) as dd from sea_jqtype");
    $vod_dsh = $dsql->GetOne("select count(*) as dd from sea_vod");
    $vod1_dsh = $dsql->GetOne("select count(*) as dd from sea_vod where stat>0");   
}

$tp_dsh = $dsql->GetOne("select count(*) as dd from sea_type");


?>		
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-body ">
                            <blockquote class="layui-elem-quote">欢迎您：
                                <span class="x-red"><?php echo $cuserLogin->getNickName(); ?></span>！当前服务器时间:<span id="time"><?= date("Y-m-d H:i:s") ?></span> 
                            </blockquote>
                        </div>
                    </div>
                </div>
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-header">信息摘要</div>
                        <div class="layui-card-body ">
                            <ul class="layui-row layui-col-space10 layui-this x-admin-carousel x-admin-backlog">
                                <li class="layui-col-md2 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>视频总数</h3>
                                        <p>
                                            <cite><?php echo $sp_dsh['dd']; ?></cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-md2 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>预约中数量</h3>
                                        <p>
                                            <cite><?php echo $yy_dsh['dd']; ?></cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-md2 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>完成录制数量</h3>
                                        <p>
                                            <cite><?php echo $wyy_dsh['dd']; ?></cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-md2 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>栏目总数</h3>
                                        <p>
                                            <cite><?php echo $tp_dsh['dd']; ?></cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-md2 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>直播流总数</h3>
                                        <p>
                                            <cite><?php echo $vod_dsh['dd']; ?></cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-md2 layui-col-xs6 ">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>正在直播</h3>
                                        <p>
                                            <cite><?php echo $vod1_dsh['dd']; ?></cite></p>
                                    </a>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
                 <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-header">系统信息</div>
                        <div class="layui-card-body ">
                            <table class="layui-table">
                                <tbody>
                                    <tr>
                                        <th>PHP版本</th>
                                        <td><?php echo @phpversion(); ?></td></tr>
                                    <tr>
                                        <th>GD版本</th>
                                        <td><?php echo @gdversion(); ?></td></tr>
                                    <tr>
                                        <th>是否安全模式</th>
                                        <td><?php echo ($isSafeMode ? 'On' : 'Off')?></td></tr>
                                    <tr>
                                        <th>支持上传的最大文件</th>
                                        <td><?php echo ini_get("post_max_size")?></td></tr>
                                    <tr>
                                        <th>Register_Globals</th>
                                        <td><?php echo ini_get("register_globals") ? 'On' : 'Off'?></td></tr>
                                    <tr>
                                        <th>Magic_Quotes_Gpc</th>
                                        <td><?php echo ini_get("magic_quotes_gpc") ? 'On' : 'Off'?></td></tr>
                                    <tr>
                                        <th>是否允许打开远程连接</th>
                                        <td><?php echo ini_get("allow_url_fopen") ? '支持' : '不支持'?></td></tr>
                                    <tr>
                                        <th>其它必须函数检测</th>
                                        <td><?php
          $needfunc = array('exec', 'dir','phpinfo','fsockopen','iconv');
          $n = 0;
          foreach($needfunc as $k) {
          	if(!function_exists($k)) {
          		echo "[{$k}×]";
          		$n++;
          	}
          }
          if($n==0) {
          	echo "符合要求";
          }
          else {
          	echo "<font color=red>部分禁用</font>";
          }
       ?></td></tr>
                                    <tr>
                                        <th>域名</th>
                                        <td><?php echo  @GetHostByName($_SERVER['SERVER_NAME']);echo " - "; echo $_SERVER['SERVER_PORT'] ?></td></tr>
                                    <tr>
                                        <th>引擎</th>
                                        <td><?php echo  @$_SERVER['SERVER_SOFTWARE']; ?></td></tr>
                                    <tr>
                                        <th>MySql版本</th>
                                        <td><?php echo $mysqlver['0']; ?></td></tr>
                                    <tr>
                                        <th>系统</th>
                                        <td><?php echo PHP_OS; ?></td></tr>										
										
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-header">开发团队</div>
                        <div class="layui-card-body ">
                            <table class="layui-table">
                                <tbody>
                                    <tr>
                                        <th>版权所有</th>
                                        <td>深深的蓝
                                            <a href="https://gitee.com/yhssdl" target="_blank">访问官网</a></td>
                                    </tr>
                                    <tr>
                                        <th>版本号</th>
                                        <td>v 2.06</td></tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>

            </div>
        </div>
        </div>
    </body>
    <script type="text/JavaScript">
    var svr_time = <?php echo  time ()*1000; ?>;
    var loc_time = Date.now();
    var span = document.getElementById("time");



    function formatDateTime(inputTime) {
        var date = new Date(inputTime);
        var y = date.getFullYear();
        var m = date.getMonth() + 1;
        m = m < 10 ? ('0' + m) : m;
        var d = date.getDate();
        d = d < 10 ? ('0' + d) : d;
        var h = date.getHours();
        h = h < 10 ? ('0' + h) : h;
        var minute = date.getMinutes();
        var second = date.getSeconds();
        minute = minute < 10 ? ('0' + minute) : minute;
        second = second < 10 ? ('0' + second) : second;
        return y + '-' + m + '-' + d+' '+h+':'+minute+':'+second;
    };

    
    function refresh() {
        var s_time = Date.now() - loc_time + svr_time;
        var t = formatDateTime(s_time);
        span.innerText = t;
        window.setTimeout(refresh,1000);
    }

    window.setTimeout(refresh,1000);
    
    </script>
</html>